home *** CD-ROM | disk | FTP | other *** search
- #include "bm.h"
- #include <string.h>
- #include "proto.h" /* N2 04-05-91 */
-
- /* scan a newline-separated string of patterns and set up the
- * vector of descriptors, one pattern descriptor per pattern.
- * Return the number of patterns */
- int MkDescVec(struct PattDesc *DescVec[], char *Pats)
- /*
- struct PattDesc *DescVec[];
- char *Pats;
- */
- {
- int NPats = 0;
- char *EndPat;
- // extern struct PattDesc *MakeDesc();
-
- while (*Pats && (EndPat = strchr(Pats,'\n')) && NPats < MAXPATS)
- {
- *EndPat = NULL;
- DescVec[NPats] = MakeDesc(Pats);
- Pats = EndPat + 1;
- ++NPats;
- } /* while */
- if (*Pats && NPats < MAXPATS)
- {
- DescVec[NPats] = MakeDesc(Pats);
- ++NPats;
- } /* if */
- return(NPats);
- } /* MkDescVec */
-